﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;

namespace WebDAV;

[ApiController]
[Route("api/cast")]
public class CastController(IHubContext<ScreenShareHub> hubContext) : ControllerBase
{
    [HttpPost("start")]
    public IActionResult StartCasting([FromBody] string mediaUrl)
    {
        // 实际逻辑：通过DLNA或自定义协议投屏
        Console.WriteLine("Casting started: " + mediaUrl);
        hubContext.Clients.All.SendAsync("CastStatus", "Casting started: " + mediaUrl);
        return Ok();
    }
}